#include <iostream>
#include <cmath>

int main () {
	auto mod  = [] (int a, int b) -> int { return a - (a/b)*b; };
	auto mod2 = [] (int a, int b) -> int { return a - floor((float)a/(float)b)*b; };
	std::cout << 4 % -3 << std::endl;        // 1
	std::cout << mod (4, -3) << std::endl;   // 1
	std::cout << mod2 (4, -3) << std::endl;  // -2

	return 0;
}